#!/bin/sh

SEASON_NUMBER=4
SEASON_DIR=2007-2008
REMOTE_HOST=ogcnicea@ftp.ogcnice-association.fr
BALLOON_DATA=/var/www/Balloon/xmlExportation

## Ne pas editer en dessous de cette ligne
BALLOON_PATH=$BALLOON_DATA/$SEASON_DIR

echo "##### BALLOON UPDATER :: Begin #####"
echo "## Debut : `date`"
echo "##"

echo "## 1. Appel distant a export.sh?s=$SEASON_NUMBER"
wget -q -O /tmp/balloon.update http://localhost/Balloon/scripts/export.php?s=$SEASON_NUMBER
echo "## `cat /tmp/balloon.update`"
rm -rf /tmp/balloon.update

echo "## 2. Synchronisation des fichiers xml"
#scp -q $BALLOON_DATA/$SEASON_DIR/*.xml $REMOTE_HOST:~/www/files/xmlData/$SEASON_DIR/.
rsync -rz $BALLOON_PATH/*.xml $REMOTE_HOST:~/www/files/xmlData/$SEASON_DIR/.

echo "## 3. Synchronisation des 'pictures'"
rsync -rz  $BALLOON_PATH/pictures/ $REMOTE_HOST:~/www/data/pictures/

echo "## 4. Synchronisation des 'pics'"
rsync -rz $BALLOON_PATH/pics/ $REMOTE_HOST:~/www/data/pics/

echo "##"
echo "## Fin   : `date`"
echo "##### BALLOON UPDATER :: End   #####"
